#include <iostream>
#include "ShareMemory.hpp"
#include "Time.hpp"
#include "Fifo.hpp"
#include <string.h>


int main()
{
    shm.GetShm();
    shm.AttachShm();
    gpipe.OpenPipeForWrite();

    // 在这里进行IPC
    struct data *image = (struct data*)shm.GetAddr();

    char ch = 'A';
    while(ch <= 'Z')
    {
        strcpy(image->status, "最新");
        strcpy(image->lasttime, GetCurrTime().c_str());
        strcpy(image->image, "xxxxxxxxxxxxxxxxxxxxxxx");

        gpipe.Signal();
        sleep(3);
        
        //strinfo[ch-'A'] = ch;
        //ch++;
    }

    shm.Detach();
    sleep(10);

    return 0;
}